package yt.MajorClass.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import yt.MajorClass.entity.Users;
import yt.MajorClass.entity.VO;
import yt.MajorClass.entity.Xgk;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2022-03-24
 */
public interface XgkMapper extends BaseMapper<Xgk> {

    //动态sql语句进行书写 这个接口其实就是帮助我们完成的业务就是那个搜索框里面完成的任务。
    @Select("<script>\n" +
            "    select * from xgk\n" +
            "    <where>\n" +
            "        <if test=\"ml!=null\">\n" +
            "            and ml like CONCAT('%',#{ml},'%')\n" +
            "        </if>\n" +
            "        <if test=\"xk!=null\">\n" +
            "            and xk like CONCAT('%',#{xk},'%')\n" +
            "        </if>\n" +
            "    </where> \n" +
            "</script>")
    List<Xgk> likeFind(String xk, String ml);


    @Select("       select *\n" +
            "        from xgk,\n" +
            "             xgk2025\n" +
            "        where key_major_count > #{count}")
    List<Xgk> selectByCount(Integer count);

    @Select("select * from xgk2025,xgk")
    List<VO> selectTwoTable();
}
